import "babel-polyfill";
import "./responsive";

// import "vant/lib/index.less"; // vant样式
import "vant/lib/index.css";
import "@/assets/less/index.less"; // 全局样式

// import "./assets/icons";

import Vue from "vue";
import App from "./App.vue";

import vant, { Toast, Lazyload } from "vant";

import $http from "./apis/request";

// import * as dd from "dingtalk-jsapi";

// 授权登录
// import { login } from "@/utils/login";
// import { dingAuth } from "./utils/ding";
// import mixins from "./mixins";

// 路由配置
import router from "./routers";

// import store from "./stores";

// import $ajax from "@/apis/request";

// import { Popup } from "@/components/popups";

// import "./plugins/prototype";

Vue.use(vant);
// Vue.use(mixins);

// 可同时显示多个吐司
Toast.allowMultiple();

// 图片懒加载
Vue.use(Lazyload, {
  lazyComponent: true,
});

// Vue.prototype.$popup = Popup;
Vue.prototype.$http = $http;

Vue.config.productionTip = false;

function setup() {
  // await login();

  const app = new Vue({
    router,
    // store,
    render: (h) => h(App),
  }).$mount("#app");

  // if (dd.env.platform === "notInDingTalk") {
  //   console.log("请在钉钉端访问此页面");
  // } else {
  //   dd.ui.pullToRefresh.disable();
  // }
  return app;
}

setup();

if (process.env.NODE_ENV == "development") {
  const VConsole = require("vconsole");
  new VConsole();
}
// if (process.env.VUE_APP_DEBUG === "1") {

// }

// import storage from "@/utils/storage";
// storage.set("user", {
//   badge: "0",
//   gender: 0,
//   bizCode: "AUX01",
//   mobile: "15306689891",
//   name: "郑坚江",
//   extattr: [
//     { name: "短号", value: "15306689891" },
//     { name: "职等", value: "4" },
//     { name: "工号", value: "0" },
//   ],
//   avatar: "",
//   position: "集团流程IT部开发工程师",
//   department: [184621409],
//   userid: "zhuxianbin",
//   status: 1,
// });

// $ajax({
//   headers: {
//     "X-JSON-RPC": 1,
//   },
//   method: "post",
//   data: JSON.stringify({
//     jsonrpc: 2.0,
//     method: "addUser",
//     params: { username: "zhuxb", password: "xxx" },
//   }),
// });
